package com.wenx.study;

import java.math.BigDecimal;

public class DecimalMain {
    public static void main(String[] args) {
        BigDecimal curDecimal = new BigDecimal(3);
        BigDecimal befDecimal = new BigDecimal(11);
        double result = curDecimal.divide(befDecimal,4,BigDecimal.ROUND_HALF_UP).doubleValue();
                //.multiply(new BigDecimal(100)).doubleValue();
        System.out.println("result = " + result);

        String str1 = "2018-12";
        String str2 = "2018-12";
        System.out.println(str2.compareTo(str1));

        System.out.println(str1.substring(0,4));

        System.out.println("123456".substring(2,6));
    }
}
